#include "sdPlayer.h"

sdPlayer::sdPlayer() : ship_(5.0, 5.0) {
    ship_.setMass(25.0);
    ship_.getBody().p = cpv(0, 0);

    ship_.setDeltaW(20.0);
    ship_.setForwardsForce(40000.0);
    ship_.setReverseForce(20000.0);
    ship_.setLeftForce(30000.0);
    ship_.setRightForce(30000.0);

    //int count = 3;
    //cpVect verts[] = {
    //    cpv(-15, -15),
    //    cpv( 0,   20),
    //    cpv( 15, -15),
    //};

    //ship_.addPolyShape(count, verts, cpvzero, 1);
    ship_.addCircleShape(0, 15, cpvzero, 1);
//    bullet->addCircleShape(0, 4, cpvzero, 1);
    /*ship_.insert();*/
}

void sdPlayer::move(cpVect& direction) {
    ship_.move(direction);
}

void sdPlayer::turn(cpVect& direction) {
    ship_.turn(direction);
}

bool sdPlayer::shoot(int weapon, sdTimed& bullet) {
    return ship_.shoot(weapon, bullet);
}

void sdPlayer::draw() {

}

